package org.example.user.manage.service;

import org.example.commons.entity.SysUser;
import org.example.commons.service.IBaseService;
import org.example.user.manage.form.SysUserSearchForm;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * 住户 服务层接口
 *
 * @author bothin
 */
public interface ISysUserService  extends IBaseService<SysUser> {
    List<SysUser> findByUserIdIn(Long[] ids);
    List<SysUser> queryAll();

    /**
     * 根据openid查询住户
     * @param openid 微信openid
     * @return 住户
     */
    SysUser findByOpenid(String openid);

    /**
     * 根据电话查询住户 用于住户的微信小程序端登录
     * @param phone 住户电话
     * @return 住户
     */
    SysUser findByPhone(String phone);

    /**
     * 条件查询住户
     * @param form SysUserSearchForm
     * @param pageable Pageable
     * @return Page<SysUser>
     */
    Page<SysUser> searchList(SysUserSearchForm form, Pageable pageable);

    String getPassword(Long id);
    void setPassword(Long id, String password);
    List<SysUser>   queryLastUserBydays(Integer days);
}
